import LoginPage from "../pages/login/index";
import Error404 from "../pages/404";
import Layout from '@/pages/layout/index.tsx';
import Error403 from '@/pages/403/index.tsx';
import React from "react";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import { funcRouter } from "./funcRouter";
import { personalRouter } from "./personalRouter";
import { resultRouter } from "./resultRouter";
const routes = [
  {
    path: "/",
    element: <LoginPage />,
  },
  {
    path: "*",
    element: <Error404 />,
  },
  {
    path: "/404",
    element: <Error404 />,
  },
  {
    path: "/403",
    element: <Error403 />,
  },
  {
    path: "/pages",
    element: <Layout/>,
    children: [
      ...funcRouter,
      ...personalRouter,
      ...resultRouter
    ]
  },
];
const router = createBrowserRouter(routes);

const RouteConponet:React.FC = () => {
  return <RouterProvider router={router} />;
};

export default RouteConponet;
